﻿using System;
using System.Collections;

namespace task4_SearchForElem
{
    class Program
    {
        static void Main(string[] args)
        {
            
            Console.WriteLine("n array:");
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine("element K?:");
            int k = int.Parse(Console.ReadLine());
            int[] array = new int[n];
            for (int i = 0; i < n; i++)
            {
                Console.Write("array[{0}]=", i);
                array[i] = int.Parse(Console.ReadLine());
                Console.WriteLine();
            }

            Array.Sort(array);

            int index = Array.BinarySearch(array, k);
            if (array[0] > k)
            {
                Console.WriteLine("Not found.");
            }
            else
            {
                if (index >= 0)
                {
                    Console.WriteLine(">= to K is {0}", array[index]);
                }
                else
                {
                    Console.WriteLine(">= to K is {0}", array[-index - 2]);
                }
            }
        }
    }
}